package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerGameGetRoomConfigResponse extends BaseQLResponse
{
    /// <summary>
    /// 捕鱼游戏房间配置列表
    /// </summary>
    public List<ButlerGameRoomConfig> ConfigList;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj.getJSONObject("error_response");
        if (t != null && !t.isNullObject())
        {
            ErrCode = t.getString("code");
            ErrMsg = t.getString("msg");
        }
        else
        {
            t = jsonObj.getJSONObject("butler_game_get_room_config_response");
            ConfigList = new ArrayList<ButlerGameRoomConfig>();
            JSONArray arrConfigList = t.getJSONObject("config_list").getJSONArray("butler_game_room_config");
            for (int i = 0; i < arrConfigList.size(); ++i)
            {
                ButlerGameRoomConfig o = new ButlerGameRoomConfig();
                o.DeserializeFromJson(arrConfigList.getJSONObject(i));
                ConfigList.add(o);
            }
        }
    }
}
